1. Field of the Invention
The present invention relates generally to apparatus and methods for programming memory systems and more particularly to apparatus and methods for programming a memory contained by a microcontroller or microprocessor utilizing certain existing features of the microcontroller or microprocessor, in conjunction with a host computer.
2. Description of Related Art
Microcontroller devices which utilize nonvolatile memories, such as Electrically Programmable Read Only Memories (EPROMs), are well known in the art. The EPROM generally contains the application software for the microcontroller and must be programmed with data depending upon the particular intended application for the microcontroller. The application software is generally developed using a personal computer, such as an IBM PC, and/or development system, such as a National Semiconductor microcontroller development system.
The data representing this application software, commonly known as a load module, are then transferred to special purpose programming equipment, such as a Data I/O Model 29 manufactured by Data I/O Corp. The EPROM of the microcontroller is then programmed by the special purpose programming equipment, usually without employing the processing capabilities of the microcontroller. When such special purpose programming equipment is used, the microcontroller is typically physically placed in the circuit of the programming equipment to accomplish the programming process.
Occasionally, it is necessary to modify the existing contents of the microcontroller's EPROM, such as during testing, development, or adjustment of the algorithm executed by the microcontroller. To perform this alteration with conventional microcontroller devices, it is usually necessary to remove the microcontroller from the system in which it is installed and place it in the circuit of the programming equipment.
Another technique that is currently used by microcontroller devices such as the Intel 87C196KB and the Motorola MC68HC705C8 can be referred to as automatic self programming (ASP). ASP requires that the microcontroller containing EPROM be placed in circuit with a source memory containing data that will be transferred to the microcontroller's EPROM. When appropriate control signals and programming voltages are applied, the microcontroller transfers data from the source memory to its own EPROM. Clearly, this technique requires the source memory to be preprogrammed by special purpose programming equipment.
Some microcontroller devices include provisions for programming the microcontroller EPROM while the unit remains installed in the system. These devices, such as the Intel 87C196KB, manifest a feature commonly known as run time programming. Run time programming schemes generally provide special circuits that allow user application software to modify the EPROM contents. This modification, or programming, is usually done by invoking a particular subroutine during the normal course of software execution. One disadvantage of run time programming is that it usually requires the user to devote a portion of the microcontroller's available memory space to support the programming function. This memory space is generally used for a software subroutine that serves as an interface between the user's application software and the microcontroller's programming mechanism. A second disadvantage of most run time programming mechanisms is that they are not well suited to programming a completely new (unprogrammed) microcontroller. Since most run time programming mechanisms are dependent on the above mentioned interface subroutine, they must have the interface subroutine installed by means of special purpose programming equipment before it can be used to program any of the remaining user memory space.
A microcontroller memory can also be programmed utilizing direct memory access (DMA). This technique is especially useful for transfers of large blocks of data between the memory and a peripheral device such as a high speed magnetic tape system. Data are written into the memory and read out of the memory by way of special channels which "steal" time slices from the central processor of the microcontroller whenever necessary. Each step of the DMA transfer is under the control of the peripheral device, with the transfer being essentially independent of the central processor, thereby enabling the processor to execute application programs while the transfer is taking place.
DMA transfers are relatively complex requiring a special DMA bus and DMA logic on the microcontroller. Further, the transfer of memory addresses and data are controlled by a processor in the peripheral device, rather than the microcontroller processor.
The present invention overcomes the above-noted shortcomings of conventional microcontroller devices. The EPROM of the device, which is completely blank or which contains an applications program, can be programmed utilizing conventional EPROM programming equipment. In addition, the subject device can be programmed after installation in a system, even if its program memory is completely blank, utilizing an external host computer. The user has complete freedom to program any data in the EPROM. The user is not required to provide a software interface subroutine of any sort to the programming mechanism, thereby maximizing the amount of memory space available for the application software. In addition, the microcontroller processor functions to program its own memory by executing a special control program thereby avoiding the complexity of DMA techniques. These and other advantages of the subject invention will become apparent to those skilled in the art upon a reading of the Detailed Description of the Preferred Embodiment together with the drawings.